import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

//无返回值一个参数
@FunctionalInterface
interface OneParameterNoReturn {
    void test(int a);
}
//无返回值多个参数
@FunctionalInterface
interface MoreParameterNoReturn {
    void test(int a,int b);
}
//有返回值无参数
@FunctionalInterface
interface NoParameterReturn {
    int test();
}

//有返回值一个参数
@FunctionalInterface
interface OneParameterReturn {
    int test(int a);
}
//有返回值多参数
@FunctionalInterface
interface MoreParameterReturn {
    int test(int a,int b);
}

//无返回值无参数
@FunctionalInterface
interface NoParameterNoReturn {
    void test();
}

interface Test1{
    public abstract void func();
}
public class TestDemo {
    public static void main(String[] args) {
        ArrayList<Integer>collection=new ArrayList<>();
        collection.add(1);
        collection.add(2);
        collection.add(3);
        collection.forEach(new Consumer<Integer>() {
            @Override
            public void accept(Integer integer) {
                System.out.print(integer+" ");
            }
        });
        collection.forEach(integer -> System.out.print(integer+" "));
    }
    public static void main2(String[] args) {
        int a = 100;
        Test1 test1=()->System.out.println(a);
    }
    public static void main1(String[] args) {
        new Test1(){
          public void func(){
              System.out.println("66");
          }
        }.func();
    }
}

